/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1635750176618_3277';

  // add your middleware config here
  config.middleware = [];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
    mysql: {
      // 单数据库信息配置
      client: {
        // host
        host: 'localhost',
        // 端口号
        port: '3306',
        // 用户名
        user: 'root',
        // 密码
        password: 'root',
        // 数据库名
        database: 'yuekao',
      },
      // 是否加载到 app 上，默认开启
      app: true,
      // 是否加载到 agent 上，默认关闭
      agent: false,
    },
    security: {
      csrf: false
    },
    gitee: {
      client_id: '37ff5eab7bcc01dbb5e4cdcbeacf9cc564f84b5febe0169c03d2be686f80db77',
      redirect_uri: 'http://localhost:8080/login',
      client_secret: '78fb22911599e27b5a4a8e20ba6ee488d78c7df651b7c30609ba8cb68dca3894'
    },
    email: {
      client: {
        host: 'smtp.163.com',
        secureConnection: true,
        port: 25,
        auth: {
          user: '15367395540@163.com',
          pass: 'KGORNZTKOCRRRCQI'
        }
      }
    },
    multipart : {
      fileSize: '2mb',
      mode: 'file',
      allowArrayField: true,
      whitelist: [
        '.jpg',
        '.jpeg',
        '.jfif',
        '.png',
      ],
    },
    oss : {
      client: {
        accessKeyId: 'LTAI5tFG7YQ9sPb2DjX1fNsf',
        accessKeySecret: 'BwdotPr1f8MWo9sDqnjMcN6NUiB3UJ',
        bucket: 'sun1233-oss',
        endpoint: 'oss-cn-beijing.aliyuncs.com',
        timeout: '60s',
      },
    }
  };
  return {
    ...config,
    ...userConfig,
  };
};
